﻿@model IList<HZU.ZP.Domain.Model.Position>
@{
    Layout = "_ApplicatLayout";
}
<script>
        $(document).ready(function () {
            $(".eee").mouseover(function () {
                $(this).css({ "background-color": "gainsboro" });
            }).mouseout(function () {
                $(this).css({ "background-color": "" });
            });
        $("button#delete").click(function () {
            if (confirm("确实要删除吗？")) {
                $.ajax({
                    type: 'post',
                    url: '/Record/DeleteCollect',
                    data: 'email=@User.Identity.Name&positionId=' + $(this).data("id"),
                    success: function (message) {
                        if (message.returnCode == "001") {
                            alert("删除成功！");
                            location.reload();

                        } else if (message.returnCode == "4070") {
                            alert("收藏记录不存在！");
                        }
                    }
                });
            }
            else {
            }
        });
             });
</script>
<div class="row clearfix">
    <div class="col-md-12 column">
        <div class="row clearfix">
            <div class="col-md-2 column">
                <span>职位名</span>
            </div>
            <div class="col-md-4 column">
                <span>企业名称</span>
            </div>
            <div class="col-md-2 column">
                <span>资薪</span>
            </div>
            <div class="col-md-2 column">
                <span>发布时间</span>
            </div>
            <div class="col-md-2 column">
                <span>操作</span>
            </div>
        </div>
        @if (Model.Count() > 0)
        {
            foreach (var pos in Model)
            {
                <div class="eee">
                    <div class="row clearfix">
                        <div class="col-md-2 column">
                            <a href="/Position/GetPositionAndCompanyInfo?id=@pos.Id" style="font-size:large;color:red">@pos.Name</a>
                        </div>
                        <div class="col-md-4 column">
                            <a href="/CompanyInformation/GetCompanyInformationA?companyId=@pos.CompanyId">@pos.CompanyName</a>
                        </div>
                        <div class="col-md-2 column">
                            @pos.Salary
                        </div>
                        <div class="col-md-2 column">
                            @pos.CreateTime.ToString("yyyy-MM-dd")
                        </div>
                        <div class="col-md-2 column">
                            <button id="delete" type="button" class="btn btn-default btn-link" data-id="@pos.Id">删除</button>
                        </div>
                    </div>
                </div>
            }
        }
        else
        {
            <h4 style="height:300px;text-align:center">无数据。。。</h4>
        }
    </div>
</div>
